from typing import Tuple, Union

from app import customer_information
from app.services import get_base_session as get_session


class CustomerInformationService:


    @staticmethod
    def get_all_shop_list() -> Tuple[bool, Union[str, list[str]]]:
        session = get_session()
        try:
            data = session.query(customer_information).with_entities(customer_information.store_name).distinct().all()
            data = [item for item, in data]
            return True, data
        except Exception as e:
            return False, str(e)
        finally:
            session.close()